// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import Qt 4.7

Item {
    id: checkbox
    width: pro_width
    height: pro_height

    signal check_statue(bool check)

    property int pro_width: 200
    property int pro_height: 50
    property string textstring: ""
    property int text_size: 33
    property string main_color: "white"
    property bool isCheck: true

    Rectangle {
        id: box
        width: 40
        color: "#00000000"
        radius: 40
        smooth: true
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 5
        anchors.top: parent.top
        anchors.topMargin: 5
        border.color: main_color
        anchors.left: parent.left
        anchors.leftMargin: 5

        Rectangle {
            id: check_item
            x: 10
            y: 8
            width: 20
            height: 20
            color: main_color
            radius: 40
            smooth: true
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
            visible: isCheck
        }
    }

    Text {
        id: text
        x: 55
        y: 6
        width: 135
        height: 39
        color: main_color
        text: textstring
        anchors.verticalCenterOffset: 1
        anchors.verticalCenter: parent.verticalCenter
        font.pixelSize: text_size
    }

    MouseArea {
        id: mouse_area1
        anchors.fill: parent

        onClicked:
        {
//            isCheck == true ? false : true ;
//            check_item.visible == true ? false : true ;
            if (isCheck == true)
            {
                isCheck = false;
                check_statue(isCheck);
            }
            else
            {
                isCheck = true;
                check_statue(isCheck);
            }
        }
    }
}
